package attendance;

import java.util.Date;
import java.util.Formatter;

public class Attendance implements Comparable<Date> {
    private Staff staff;
    private Date date;

    private Date arriveTime;
    private Date leaveTime;
    private String arriveNote;
    private String leaveNote;

    private double lateMinute;
    private double earlyMinute;

    private double overtimeHour;
    private double absentDay;
    private double missCount;

    public Staff getStaff() {
        return staff;
    }

    public void setStaff(Staff staff) {
        this.staff = staff;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Date getArriveTime() {
        return arriveTime;
    }

    public void setArriveTime(Date arriveTime) {
        this.arriveTime = arriveTime;
    }

    public Date getLeaveTime() {
        return leaveTime;
    }

    public void setLeaveTime(Date leaveTime) {
        this.leaveTime = leaveTime;
    }

    public String getArriveNote() {
        return arriveNote;
    }

    public void setArriveNote(String arriveNote) {
        this.arriveNote = arriveNote;
    }

    public String getLeaveNote() {
        return leaveNote;
    }

    public void setLeaveNote(String leaveNote) {
        this.leaveNote = leaveNote;
    }

    public double getLateMinute() {
        return lateMinute;
    }

    public void setLateMinute(double lateMinute) {
        this.lateMinute = lateMinute;
    }

    public double getEarlyMinute() {
        return earlyMinute;
    }

    public void setEarlyMinute(double earlyMinute) {
        this.earlyMinute = earlyMinute;
    }

    public double getOvertimeHour() {
        return overtimeHour;
    }

    public void setOvertimeHour(double overtimeHour) {
        this.overtimeHour = overtimeHour;
    }

    public double getAbsentDay() {
        return absentDay;
    }

    public void setAbsentDay(double absentDay) {
        this.absentDay = absentDay;
    }

    public double getMissCount() {
        return missCount;
    }

    public void setMissCount(double missCount) {
        this.missCount = missCount;
    }

    @Override
    public int compareTo(Date d) {
        return this.date.compareTo(d);
    }

    public String toString() {
        Formatter format = new Formatter();
        format.format("%s %s %s %s %s", getDate(),
                getArriveTime(), getArriveNote(), getLeaveTime(),
                getLeaveNote());
        String result = format.toString();
        format.close();
        return result;
    }

}
